//
//  SKVistorView.m
//  WeiBo(MVVM-OC)
//
//  Created by yanli on 16/7/15.
//  Copyright © 2016年 mountainPassCell. All rights reserved.
//

#import "SKVistorView.h"            //访客视图


@interface SKVistorView ()
// 旋转图片
@property (nonatomic, strong) UIImageView *cycleImageView;
// 遮罩罩层
@property (nonatomic, strong) UIImageView *maskImageView;
// 主页图片
@property (nonatomic, strong) UIImageView *iconImageView;
// 消息
@property (nonatomic, strong) UILabel *messageLabel;
// 注册
@property (nonatomic, strong) UIButton *registerButton;
// 登录
@property (nonatomic, strong) UIButton *loginButton;

@end

@implementation SKVistorView

#pragma mark -- 懒加载
// 旋转图片 懒加载
- (UIImageView *)cycleImageView {
    if (!_cycleImageView) {
        _cycleImageView = [[UIImageView new] initWithImage:[UIImage imageNamed:@"visitordiscover_feed_image_smallicon"]];
    }
    return _cycleImageView;
}

// 遮罩罩层 懒加载
- (UIImageView *)maskImageView {
    if (!_maskImageView) {
        _maskImageView = [[UIImageView new] initWithImage:[UIImage imageNamed:@"visitordiscover_feed_mask_smallicon"]];
    }
    return _maskImageView;
}

//  主页图片 懒加载
- (UIImageView *)iconImageView {
    if (!_iconImageView) {
        _iconImageView = [[UIImageView new] initWithImage:[UIImage imageNamed:@"visitordiscover_feed_image_house"]];

    }
    return _iconImageView;
}

//  消息 懒加载
- (UILabel *)messageLabel {
    if (!_messageLabel) {
        // 初始化
        _messageLabel = [UILabel new];
        // 设置
        _messageLabel.font = [UIFont systemFontOfSize:14];
        _messageLabel.textColor = [UIColor grayColor];
        _messageLabel.text = @"关注一些人，回这里看看有什么惊喜关注一些人，回这里看看有什么惊喜";
        // 多行显示
        _messageLabel.numberOfLines = 0;
        // 设置文字居中
        _messageLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _messageLabel;
}

// 注册 懒加载
- (UIButton *)registerButton {
    if (!_registerButton) {
        _registerButton = [UIButton new];
        //添加 注册 btn 的点击事件
        [_registerButton addTarget:self action:@selector(registerButton) forControlEvents:UIControlEventTouchUpInside];
        //设置 文字
        [_registerButton setTitle:@"注册" forState:UIControlStateNormal];
        //设置 文字颜色
        [_registerButton setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
        [_registerButton setTitleColor:[UIColor orangeColor] forState:UIControlStateHighlighted];
        //设置 背景图片
        [_registerButton setBackgroundImage:[UIImage imageNamed:@"common_button_white_disable"] forState:UIControlStateNormal];
        // 设置字体大小
        _registerButton.titleLabel.font = [UIFont systemFontOfSize:15];
    }
    return _registerButton;
}


// 登录 懒加载
- (UIButton *)loginButton {
    if (!_loginButton) {
        _loginButton = [UIButton new];
        //添加 登录 btn 的点击事件
        [_loginButton addTarget:self action:@selector(loginButtonAction) forControlEvents:UIControlEventTouchUpInside];
        //设置 文字
        [_loginButton setTitle:@"登录" forState:UIControlStateNormal];
        //设置 文字颜色
        [_loginButton setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
        [_loginButton setTitleColor:[UIColor orangeColor] forState:UIControlStateHighlighted];
        //设置 背景图片
        [_loginButton setBackgroundImage:[UIImage imageNamed:@"common_button_white_disable"] forState:UIControlStateNormal];
        // 设置字体大小
        _loginButton.titleLabel.font = [UIFont systemFontOfSize:15];
    }
    return _loginButton;
}

#pragma mark --  重写
- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        
        //[self addSubview:self.composeBtn];
        //  搭建界面
        [self setupUI];
    }
    return self;
}


//  搭建界面
- (void)setupUI {
    // 设置访客视图颜色
    self.backgroundColor = [UIColor colorWithWhite:237 / 255.0 alpha:1.0];
    // 添加到视图 在进行布局
    [self addSubview:self.cycleImageView];
    
}


#pragma mark -- 注册登录 点击事件
// 注册
- (void)registerButtonAction {
    NSLog(@"访客视图的注册按钮点击了");
}

// 登录
- (void)loginButtonAction {
    NSLog(@"访客视图的登录点击了");
}



#pragma mark -- 开启动画,提供修改信息的访客视图
// 开启动画
- (void)startAnimation {
    
}

// 提供修改信息的访客视图
- (void)updateVisitorViewInfo:(NSString *)title imageName:(NSString *)imageName {
    
}

@end














